﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ProgNetComponents.Design.Attributes
{
    /// <summary>
    /// BrowsableAttribute(false) if MachingValues contains Property Value of target object
    /// </summary>
    public class DynamicHiddenByPropertyAttribute :DynamicPropertyDependentAttribute
    {
        public DynamicHiddenByPropertyAttribute(string PropertyName, params object[] MachingValues)
            : base(PropertyName, MachingValues)
        {

        }
        protected override Attribute GetAttribute(bool PropertyValueMatch)
        {
            if (PropertyValueMatch)
                return System.ComponentModel.BrowsableAttribute.No;
            return null;
        }
    }
}
